import request from '@/utils/request'
// 流程环节按钮配置 API接口
const act_dsn_form_stepbtnApi = {
    list: '/act_dsn_form_stepbtn/list',
    save: '/act_dsn_form_stepbtn/save',
    view: '/act_dsn_form_stepbtn/view',
    del: '/act_dsn_form_stepbtn/delete',
    dels: '/act_dsn_form_stepbtn/batchDel',
    output: '/act_dsn_form_stepbtn/output',
    exportExcelTemplate: '/act_dsn_form_stepbtn/exportExcelTemplate',
    importExcel: '/act_dsn_form_stepbtn/importExcel',
    batchSave: '/act_dsn_form_stepbtn/batchSave'
}

/**
 * 批量修改或保存流程环节按钮配置
 * @param {*} parameter
 */
 export function stepbtnBatchSave(formid, stepid, list) {
    return request({
      url: act_dsn_form_stepbtnApi.batchSave,
      method: 'post',
      params: {
        formid,
        stepid
      },
      data: list
    })
  }

/**
 * 导入流程环节按钮配置Excel
 */
export function importExcel(data) {
  var body = new FormData()
  body.append("file", data);
  return request({
    url: act_dsn_form_stepbtnApi.importExcel,
    headers: {"Content-Type": "multipart/form-data"},
    method: 'post',
    data: body
  })
}

/**
 * 导出流程环节按钮配置Excel模板
 */
export function exportExcelTemplate () {
    return request({
        url: act_dsn_form_stepbtnApi.exportExcelTemplate,
        method: 'post',
        responseType: 'blob'
    })
}

/**
 * 导出流程环节按钮配置
 */
export function output (data) {
    return request({
        url: act_dsn_form_stepbtnApi.output,
        method: 'post',
        data: data ,
        responseType: 'blob'
    })
}
/**
 * 批量删除流程环节按钮配置
 * @param {*} ids
 */
export function delAct_dsn_form_stepbtns (ids) {
    return request({
        url: act_dsn_form_stepbtnApi.dels,
        method: 'post',
        params: {ids}
    })
}
/**
 * 删除流程环节按钮配置
 * @param {*} id
 */
export function delAct_dsn_form_stepbtn (id) {
    return request({
        url: act_dsn_form_stepbtnApi.del,
        method: 'post',
        params: {id}
    })
}
/**
 * 查看、编辑流程环节按钮配置
 * @param {*} id
 */
export function viewAct_dsn_form_stepbtn (id) {
    return request({
        url: act_dsn_form_stepbtnApi.view,
        method: 'get',
        params: {id}
    })
}
/**
 * 保存流程环节按钮配置
 * @param {*} body
 */
export function saveAct_dsn_form_stepbtn (body) {
    return request({
        url: act_dsn_form_stepbtnApi.save,
        method: 'post',
        data: body
    })
}
/**
 * 查询流程环节按钮配置列表
 * @param {*} body
 */
export function queryAct_dsn_form_stepbtnList (body) {
    return request({
        url: act_dsn_form_stepbtnApi.list,
        method: 'post',
        data: body
    })
}